import React, { useEffect } from "react";
import { Navigate, useParams, useSearchParams, Outlet  } from "react-router-dom";

const Authmiddleware = (props) => {
  // let [searchParams, setSearchParams] = useSearchParams();
  
  // useEffect(() => {
  //   console.log("Authmiddleware", searchParams, props);
  // }, [searchParams]);

  if (!localStorage.getItem("authUser") && false) {
    return (
      <Navigate to={{ pathname: "/login", state: { from: props.location } }} />
    );
  }
  return <Outlet />;
};

export default Authmiddleware;
